/**
 * Copyright (c) 2010-2020 by skzr.org
 * All rights reserved.
 * @Author <a href="mailto:skzr.org@gmail.com">skzr.org</a>
 * @date 2011-3-17 下午10:58:29
 */
package org.skzr.logging.util.impl;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import org.skzr.logging.util.IResource;

/**
 * @author <a href="mailto:skzr.org@gmail.com">skzr.org</a>
 * @version 1.0.0
 * @since JDK1.6
 */
public class ResourceFile implements IResource {
	private final transient File file;
	
	public ResourceFile(File file) {
		this.file = file;
	}
	
	@Override
	public String toString() {
		return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " " + file;
	}

	@Override
	public String getFileName() {
		return file.getName();
	}

	@Override
	public InputStream getInputStream() throws FileNotFoundException {
		return new FileInputStream(file);
	}
}